from PIL import Image
import numpy as np
from matplotlib import pyplot as plt
png_path = "./db/6.png"
png = Image.open(png_path)
png = png.convert("L")
print(png.size)
dt = np.zeros((None, 28, 28), dtype=int)
# print(dt)
for y in range(png.size[1]):
    for x in range(png.size[0]):
        pixel = png.getpixel((x, y))
        dt[y][x] = 255 - pixel

dt = dt / 255.0
plt.figure()
plt.imshow(dt)
plt.colorbar()
plt.grid(False)
plt.show()
